package popcount

func PopCount(x uint64) int {
	count := 0
	mask := uint64(1)
	for range 64 {
		if x&mask > 0 {
			count++
		}
		x >>= 1
	}
	return count
}
